{template 'header', 'member'}
<script type="text/javascript">c(1);</script>
{if $job}
{template 'my_club_'.$job, 'member'}
{else}
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="110" id="submenu"></td>
{if $action == 'add'}
<td class="tab" id="add"><a href="?mid={$mid}&action=add&gid={$gid}"><span>发表帖子</span></a></td>
{/if}
{if $_userid}
<td class="tab" id="s3"><a href="?mid={$mid}"><span>已发布<span class="px10">({$nums[3]})</span></span></a></td>
<td class="tab" id="s2"><a href="?mid={$mid}&status=2"><span>审核中<span class="px10">({$nums[2]})</span></span></a></td>
<td class="tab" id="s1"><a href="?mid={$mid}&status=1"><span>未通过<span class="px10">({$nums[1]})</span></span></a></td>
{/if}
</tr>
</table>
</div>

{if $action=='add' || $action=='edit'}
<iframe src="" name="send" id="send" style="display:none;"></iframe>
<form method="post" action="?" id="dform" target="send" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="gid" value="{$gid}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellpadding="6" cellspacing="1" class="tb">
{if $status==1 && $action=='edit' && $note}
<tr>
<td class="tl">未通过原因</td>
<td class="tr f_blue">{$note}</td>
</tr>
{/if}
<tr>
<td class="tl">所属商圈</td>
<td class="tr"><a href="{$MOD[linkurl]}{$GRP[linkurl]}" class="t">{$GRP[title]}</a></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 帖子标题</td>
<td class="tr"><input name="post[title]" type="text" id="title" size="60" value="{$title}"/> <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">标题图片</td>
<td class="tr"><input name="post[thumb]" id="thumb" type="text" size="60" value="{$thumb}" readonly/>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="Dthumb({$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb').value, true);" class="t">[上传]</a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="_preview(Dd('thumb').value);" class="t">[预览]</a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="Dd('thumb').value='';" class="t">[删除]</a></td>
</tr>
{if $CP}
<script type="text/javascript">
var property_catid = {$catid};
var property_itemid = {$itemid};
var property_admin = 0;
</script>
<script type="text/javascript" src="{DT_STATIC}file/script/property.js"></script>
<tbody id="load_property" style="display:none;">
<tr><td></td><td></td></tr>
</tbody>
{/if}
{if $FD}{fields_html('<td class="tl">', '<td class="tr">', $item)}{/if}
<tr>
<td class="tl"><span class="f_red">*</span> 帖子内容</td>
<td class="tr"><textarea name="post[content]" id="content" class="dsn">{$content}</textarea>
{deditor($moduleid, 'content', $group_editor, '100%', 350)}<br/><span id="dcontent" class="f_red"></span>
</td>
</tr>
{if $MOD[swfu] == 1 && DT_EDITOR == 'fckeditor' && !$DT_TOUCH}
{php include DT_ROOT.'/api/swfupload/editor.inc.php';}
{/if}
{if $fee_add}
<tr>
<td class="tl">发布此信息需消费</td>
<td class="tr"><span class="f_b f_red">{$fee_add}</span> {$fee_unit}</td>
</tr>
{if $fee_currency == 'money'}
<tr>
<td class="tl">{$DT[money_name]}余额</td>
<td class="tr"><span class="f_blue f_b">{$_money}{$fee_unit}</span> <a href="charge.php?action=pay" target="_blank" class="t">[充值]</a></td>
</tr>
{else}
<tr>
<td class="tl">{$DT[credit_name]}余额</td>
<td class="tr"><span class="f_blue f_b">{$_credit}{$fee_unit}</span> <a href="credit.php?action=buy" target="_blank" class="t">[购买]</a></td>
</tr>
{/if}
{/if}
{if $need_password}
<tr>
<td class="tl"><span class="f_red">*</span> 支付密码</td>
<td class="tr">{template 'password', 'chip'} <span id="dpassword" class="f_red"></span></td>
</tr>
{/if}
{if $need_question}
<tr>
<td class="tl"><span class="f_red">*</span> 验证问题</td>
<td class="tr">{template 'question', 'chip'} <span id="danswer" class="f_red"></span></td>
</tr>
{/if}
{if $need_captcha}
<tr>
<td class="tl"><span class="f_red">*</span> 验证码</td>
<td class="tr">{template 'captcha', 'chip'} <span id="dcaptcha" class="f_red"></span></td>
</tr>
{/if}
{if $action=='add'}
<tr style="display:none;" id="weibo_sync">
<td class="tl">同步主题</td>
<td class="tr" id="weibo_show"></td>
</tr>
{/if}
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 提 交 " class="btn_g"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="btn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
{load('clear.js')}
{if $action=='add'}
<script type="text/javascript">s('mid_{$mid}');m('{$action}');</script>
{else}
<script type="text/javascript">s('mid_{$mid}');m('s{$status}');</script>
{/if}
{else}
<div class="tt">
<form action="?">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="status" value="{$status}"/>
&nbsp;
<input type="text" size="50" name="kw" value="{$kw}" title="关键词"/>&nbsp;
<input type="submit" value=" 搜 索 " class="btn"/>
<input type="button" value=" 重 置 " class="btn" onclick="Go('?mid={$mid}&status={$status}');"/>
</form>
</div>
<div class="ls">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th>
<th>标题</th>
<th>商圈</th>
<th width="120">发表时间</th>
<th>人气</th>
<th>回复</th>
<th width="80">管理</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td><input type="checkbox" name="itemid[]" value="{$v[itemid]}"/></td>
<td align="left" title="{$v[alt]}"><a href="{$v[linkurl]}" target="_blank" class="t">{$v[title]}</a>{if $v[status]==1 && $v[note]} <a href="javascript:" onclick="alert('{$v[note]}');"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/why.gif" title="未通过原因"/></a>{/if}</td>
<td>&nbsp;&nbsp;<a href="{$v[groupurl]}" target="_blank">{$v[groupname]}</a>&nbsp;&nbsp;</td>
<td class="f_gray px11">{$v[adddate]}</td>
<td class="f_gray px11">{$v[hits]}</td>
<td class="f_gray px11">{$v[reply]}</td>
<td>
<a href="?mid={$mid}&job={$job}&action=edit&itemid={$v[itemid]}"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="修改" alt=""/></a>
{if $MG[delete]}&nbsp;<a href="?mid={$mid}&job={$job}&action=delete&itemid={$v[itemid]}" onclick="return confirm('确定要删除吗？此操作将不可撤销');"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/delete.png" title="删除" alt=""/></a>{/if}
</td>
</tr>
{/loop}
</table>
</div>
{if $MG[club_limit] || (!$MG['fee_mode'] && $MOD[fee_add])}
<div class="limit">
{if $MG[club_limit]}
总共可发 <span class="f_b f_red">{$MG[club_limit]}</span> 条&nbsp;&nbsp;&nbsp;
当前已发 <span class="f_b">{$limit_used}</span> 条&nbsp;&nbsp;&nbsp;
还可以发 <span class="f_b f_blue">{$limit_free}</span> 条&nbsp;&nbsp;&nbsp;
{/if}
{if !$MG['fee_mode'] && $MOD[fee_add]}
发布信息收费 <span class="f_b f_red">{$MOD[fee_add]}</span> {if $MOD[fee_currency] == 'money'}{$DT[money_unit]}{else}{$DT[credit_unit]}{/if}/条&nbsp;&nbsp;&nbsp;
可免费发布 <span class="f_b">{if $MG[club_free_limit]<0}无限{else}{$MG[club_free_limit]}{/if}</span> 条&nbsp;&nbsp;&nbsp;
{/if}
</div>
{/if}
<div class="pages">{$pages}</div>
<script type="text/javascript">s('mid_{$mid}');m('s{$status}');</script>
{/if}
{if $action == 'add' || $action == 'edit'}
<script type="text/javascript">
function check() {
	var l;
	var f;
	f = 'title';
	l = Dd(f).value.length;
	if(l < 5 || l > 30) {
		Dmsg('标题应为5-30字，当前已输入'+l+'字', f);
		return false;
	}
	f = 'content';
	l = FCKLen();
	if(l < 15 || l > 50000) {
		Dmsg('内容应为15-50000字，当前已输入'+l+'字', f);
		return false;
	}
	{if $FD}{fields_js()}{/if}
	{if $CP}{property_js()}{/if}
{if $need_password}
	f = 'password';
	l = Dd(f).value.length;
	if(l < 6) {
		Dmsg('请填写支付密码', f);
		return false;
	}
{/if}
{if $need_question}
	f = 'answer';
	l = Dd(f).value.length;
	if(l < 1) {
		Dmsg('请填写验证问题', f);
		return false;
	}
	if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
		Dd(f).focus();
		return false;
	}
{/if}
{if $need_captcha}
	f = 'captcha';
	l = Dd(f).value;
	if(!is_captcha(l)) {
		Dmsg('请填写正确的验证码', f);
		return false;
	}
	if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
		Dd(f).focus();
		return false;
	}
{/if}
	return true;
}
var destoon_oauth = '{$EXT[oauth]}';
</script>
{/if}
{if $action=='add' && strlen($EXT[oauth]) > 1}{load('weibo.js')}{/if}
{/if}

<script type="text/javascript">
var h = '';
h += '<div class="submenu">';
h += '<div></div><ul>';
h += '<li id="sub_"><a href="?mid={$mid}">我的帖子</a></li>';
h += '<li id="sub_group"><a href="?mid={$mid}&job=group">我的商圈</a></li>';
h += '<li id="sub_reply"><a href="?mid={$mid}&job=reply">我的回复</a></li>';
h += '<li id="sub_join"><a href="?mid={$mid}&job=join">加入商圈</a></li>';
h += '<li id="sub_fans"><a href="?mid={$mid}&job=fans">粉丝管理</a></li>';
h += '<li id="sub_manage"><a href="?mid={$mid}&job=manage">商圈管理</a></li>';
h += '</ul></div>';
$('#submenu').html(h);
$('.submenu div').html($('#sub_{$job} a').html());
$('#sub_{$job}').hide()
$('.submenu').mouseover(function(){
	$('.submenu ul').show(100);
	$('.submenu').bind('mouseleave',function(){ 
		$('.submenu ul').hide(); 
	});
});
</script>
{template 'footer', 'member'}